package com.lglin.dao.user;


import com.lglin.bean.user.entity.User;
import com.lglin.bean.user.entity.UserRole;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserRoleDao {
    @Insert("insert into user_role(uid,rid)value(#{id},2)")
    int addUserRoleRelate(User user);

    @Select("select * from user_role where uid=#{uid}")
    List<UserRole> listByUserId(int uid);
    @Insert("insert into user_address(uid,aid)value(#{uid},#{aid})")
    int addUserAddress(@Param("uid") int uid,@Param("aid") int aid);
}
